package TestCTR;

import org.junit.Test;
import java.util.ArrayList;

import CTRLayer.*;
import ModelLayer.*;

public class TestLogbookCTR
{
	private LogbookCTR  lbc = new LogbookCTR();
	private Logbook lb = new Logbook();
	
	@Test
	public void testFindAllLogbooks() {
		ArrayList<ModelLayer.Logbook> lblist = lbc.findAllLogbooks();
		int id = 0;
		System.out.println("\nElementer i Logbook : " + lblist.size() + "\n");
		while (id <= lblist.size())
		{
			System.out.println("Dato : " + lblist.get(id).getDate() + " - Note : "  + lblist.get(id).getNote());
			id++;
		}
	}

	@Test
	public void testFindLogbookID()
	{
		int id = 1;
		lb = lbc.findLogbookID(id);
		System.out.println("LogbookID  : " + lb.getLogbookID());
		System.out.println("Dato       : " + lb.getDate());
		System.out.println("Note       : " + lb.getNote());
		System.out.println("TrainedID  : " + lb.getTrainedID());
	}

	@Test
	public void testFindLogbookByTrainedID()
	{
		int trainedID = 1;
		ArrayList<Logbook> lblist = lbc.findAllLogbooksByTrainedID(trainedID);
		for(Logbook logbook : lblist)
		{
			System.out.println("Note: " + logbook.getNote());
		}
	}
}
